1. Field of the Invention
The present invention relates to searching for packet identifiers, and is particularly but not exclusively concerned with the location of appropriate packet identifiers and their corresponding keys for encryption/decryption of transport stream packet payloads in a digital video bit stream.
2. Description of the Related Art
In a digital video bit stream, packets carry encrypted payloads. To construct a packet, a payload is encrypted using an encryption key, information about which is encoded by the packet identifier. The decryption key which can be used to decrypt the encrypted payload when the packet is received is thus identified in the packet identifier of the packet. In order to establish encryption/decryption keys, each packet identifier is interrogated and memory locations of a memory holding a plurality of packet identifiers are scanned sequentially until a match is found. Once a matching packet identifier has been located, the corresponding encryption/decryption key can be retrieved by a simple transformation of the address of the memory location holding that packet identifier.
Currently, memory locations are scanned in order of memory address, from the first memory address to the last memory address. If an incoming packet identifier happens to have a match at the last memory location to be scanned, obviously the total time to extract the right encryption/decryption key is longer than if the packet identifier was at the first memory location. Currently, the order of packet identifiers in a memory is either random or, if the software has prior knowledge of the frequency of certain packet identifiers in the transport stream, the packet identifiers may be ordered in memory such that the most frequently occurring is placed at the first memory address, and the least frequently occurring at the last address, with a grading in between.
In current systems, the number of packet identifiers which are normally stored means that in fact there is not a large overhead in carrying out the search for packet identifiers, regardless of the order in which the memory locations are scanned. However, as the requirement grows for a greater number of packet identifiers/encryption/decryption keys to be stored, the packet identifier search time will become more significant as a proportion of total processing time. Also, in all cases of typical transport streams, some PIDs occur many more time than others.